# 以下是第一阶段构建
#FROM python:3.10.0-slim
#LABEL MAINTAINER="zhuqingchuang"
#RUN apt-get update && apt-get install -y gcc && apt-get install -y nginx
#RUN apt-get update && apt-get install  -y nginx
#ENV APP_HOME=/var/www/html/django
#RUN mkdir -p $APP_HOME
#WORKDIR $APP_HOME
#COPY requirements.txt .
#COPY ./nginx/nginx.conf /etc/nginx/
#RUN pip  --no-cache-dir install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
#RUN pip install uwsgi
#RUN pip  --no-cache-dir install uwsgi -i https://mirrors.aliyun.com/pypi/simple/
#RUN rm -rf /var/cache/apk/*
# 以下是第二阶段构建
FROM registry.cn-hangzhou.aliyuncs.com/zhuqingchuang/xxjstk:django-base-2024-8-7-4
RUN pip  --no-cache-dir install python_dotenv==1.1.0 -i https://mirrors.aliyun.com/pypi/simple/
RUN pip  --no-cache-dir install alibabacloud_ocr_api20210707==3.1.3 -i https://mirrors.aliyun.com/pypi/simple/
RUN pip  --no-cache-dir install alibabacloud_darabonba-stream==0.0.2 -i https://mirrors.aliyun.com/pypi/simple/
ENV APP_HOME=/var/www/html/django
COPY . /var/www/html/django
RUN rm -rf /etc/nginx/nginx.conf
COPY ./nginx/nginx.conf /etc/nginx/
WORKDIR $APP_HOME
RUN rm -rf .git
RUN rm -rf /var/www/html/django/static/images/*
RUN mkdir -p static_new
RUN chmod +x ./start.sh
EXPOSE 8000